<?php
if(!isset($MAIN)){
	include_once("includes/class.ibnfm.php");
	$MAIN = new MAIN();
}
$MAIN->users->checkLogin(false);
?>
<div id="logs">
<?php
switch($_REQUEST['log_type']){
	case "profile":
	case "user":
		$uid = ($_REQUEST['log_type']=="profile")?$MAIN->decode($_SESSION[svar]):$_REQUEST['user_id'];
?>
	<table cellpadding="0" cellspacing="0" class="list">
	<tr>
		<th></th>
		<th>Typ</th>
		<th>Besrivning</th>
		<th>fån IP</th>
	</tr>
<?php
$logs=$MAIN->logs->getUserLogs($uid);
foreach($logs as $log){
?>
	<tr>
		<td style="text-align:left;"><?php echo(date("Y-m-d H:s",strtotime($log["modif"])));?></td>
		<td><?php echo($log["type"]);?></td>
		<td><?php echo($log["description"]);?></td>
		<td><?php echo($log["field2"]);?></td>
	</tr>
<?php
}
?>
	</table>
<?php
	break;
	default:
		break;
}
?>
</div>